<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/8/17
 * Time: 16:08
 */
namespace app\wechat_admin\service;

use app\common\model\Article;

class ArticleService {
    private static $article;
    public function __construct() {
        self::$article = new Article();
    }

    public static function getArticleList($where, $limit) {
        new self;
        $list = self::_getArticleList($where, $limit);
        $total = self::_getArticleTotal($where);
        $return = [
            'data' => $list,
            'total' => $total,
        ];
        return $return;
    }

    public static function getArticleDetail($where) {
        new self;
        $list = self::$article->getOneInfo($where);
        return $list;
    }

    private static function _getArticleList($where, $limit) {
        $list = self::$article->getList($where, $limit);
        return $list;
    }

    private static function _getArticleTotal($where) {
        $total = self::$article->getTotal($where);
        return $total;
    }
    
    


}